Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(e2e): add boilerplate and tests #556

Merged
merged 68 commits into from
Sep 13, 2024
Merged

test(e2e): add boilerplate and tests #556

merged 68 commits into from
Sep 13, 2024

Conversation

sidvishnoi
Copy link
Member

@sidvishnoi sidvishnoi commented Aug 29, 2024

Closes #542

  • Add basic functionality to load extension
  • Make authentication for rafiki.money work
  • Make connect wallet work
  • Add tests to ensure boilerplate is enough.
  • Add docs on how to setup env for E2E tests locally
  • Create an account on rafiki.money for CI
  • Add secrets and env vars to GitHub/CI (test environment)
  • Run E2E tests:
    • manually by adding a review comment to PR (with body /test)
    • daily before nightly build
  • Run tests for:
    • Google Chrome on Ubuntu
    • MS Edge on Ubuntu
  • Prevent confidential info leak
    • Encrypt playwright report artifacts
    • Prevent potential secrets to be logged in CI (like interactRef)

@github-actions github-actions bot added the area: ci Improvements or additions to repository workflows label Aug 29, 2024
Copy link
Contributor

github-actions bot commented Aug 29, 2024

Extension builds preview

Name Link
Latest commit ed3e0c3
Latest job logs Run #10848587613
BadgeDownload
BadgeDownload

@sidvishnoi sidvishnoi changed the title tests: add e2e test boilerplate [WIP] test: add e2e test boilerplate [WIP] Aug 29, 2024
@sidvishnoi
Copy link
Member Author

Locally:
image

@sidvishnoi
Copy link
Member Author

sidvishnoi commented Aug 30, 2024

TODO:

  • Figure out making it work with headless: false in CI (tests fail locally with headless: true)
    • Works fine on my machine with pnpm test:e2e --project=chromium.
  • Figure out way to open popup as a popup, as no browser/automation supports clicking browser action as such (i.e. we need to simulate that behavior, as if popup is open like that)

@sidvishnoi
Copy link
Member Author

Locally:
image

@sidvishnoi
Copy link
Member Author

sidvishnoi commented Sep 2, 2024

Figure out way to open popup as a popup, as no browser/automation supports clicking browser action as such (i.e. we need to simulate that behavior, as if popup is open like that)

One approach could be we open the open as a separate window. Then we won't have to rely on "action.openPopup()" which is flaky.
But we'd have to handle focus change events correctly, as popup will always be open (See log: "Popup is open, ignoring focus change").

Checking how to make it work with headless: true or make headless: false work on GitHub Actions. If not possible on CI, being able to run locally would be worthwhile anyway, just more manual and more chances of "works on my machine".

@sidvishnoi
Copy link
Member Author

Apparently, we can't have headless: true with extensions: https://issues.chromium.org/issues/41309918#comment6. Will have to use xvfb if we want this running in CI.

TODO: make it work with beforeAll or think if global setup will do fine
@sidvishnoi
Copy link
Member Author

Chromium tests passed in CI! (although one is already flaky!)

Copy link
Member

@raducristianpopa raducristianpopa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test-e2e

Copy link
Member

@raducristianpopa raducristianpopa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test-e2e

Copy link
Member

@raducristianpopa raducristianpopa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test-e2e

Copy link
Member Author

@sidvishnoi sidvishnoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test-e2e

- had too much nesting
- decrypt didn't work on mac
- on ubuntu it was annoying too
Copy link
Member Author

@sidvishnoi sidvishnoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test-e2e

@sidvishnoi sidvishnoi merged commit 6d9869f into main Sep 13, 2024
11 checks passed
@sidvishnoi sidvishnoi deleted the e2e-tests branch September 13, 2024 12:07
@sidvishnoi sidvishnoi added the area: tests Improvements or additions to tests label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ci Improvements or additions to repository workflows area: documentation Improvements or additions to documentation area: popup Improvements or additions to extension popup area: tests Improvements or additions to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automate ext testing
2 participants